<template>
    <div class="box">
        <div class="header">
            <van-nav-bar title="详情" left-text="返回" left-arrow>
                <template #left>
                    <van-icon name="arrow-left" />
                </template>
            </van-nav-bar>
            <ul>
        <li v-for="item in list" :key="item.id" >
         
            <p><img :src="item.image" alt=""></p>
            <p class="van-multi-ellipsis--l2">{{ item.title }}</p>
            <p style="color: red;">{{ item.price }}</p>
       
        </li>
       
    </ul>
        </div>
        <div class="meddle"></div>
    </div>
</template>
<script setup>
 import request from '@/utils/request.js';
    import { onMounted, ref } from "vue";
    import { useRoute } from "vue-router";
    const router=useRoute()
    const  list= ref([])
    onMounted(()=>{
        request.get(`/detail/:id`,{
            params:{
               route:id.value
            }
        }).then(res=>{
            if(res.data.code==200){
                list.value=res.data.data
            }
        })
    })
</script>